﻿using System;
using System.Collections.Generic;
using System.Data.Entity.ModelConfiguration;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using CarShop.Domain.Entities;

namespace CarShop.Data.EntityFramework.Mappings
{
    internal class EntityBaseConfiguration<TEntity, TKey> : EntityTypeConfiguration<TEntity>
        where TEntity : EntityBase<TKey>
    {
        public EntityBaseConfiguration()
        {
            //Primary key
            this.HasKey(e => e.Id);

            //Properties
            this.Property(e => e.CreationDate).IsRequired();
            this.Property(e => e.UpdateDate).IsRequired();
            this.Property(e => e.UpdateLogin).IsRequired();
        }
    }
}
